package com.zp.business.service.clinicOrder;


import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.zp.business.entity.clinicOrder.ClinicOrders;
import com.zp.business.entity.clinicOrder.bo.ClinicOrderParam;
import com.zp.business.entity.clinicOrder.bo.ClinicOrdersBo;
import com.zp.business.entity.clinicOrder.vo.ClinicOrdersVo;
import com.zp.common.myBatis.core.page.PageQuery;
import com.zp.common.myBatis.core.page.TableDataInfo;

import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;

/**
 * 门诊医嘱Service接口
 *
 * @author zhang peng
 * @ date 2024-01-05
 */
public interface IClinicOrdersService {

    /**
     * 查询门诊医嘱
     */
    ClinicOrdersVo queryById (String id);

    /**
     * 查询门诊医嘱列表(分页)
     */
    TableDataInfo<ClinicOrdersVo> queryPageList (ClinicOrdersBo bo, PageQuery pageQuery);

    /**
     * 查询门诊医嘱列表(不分页)
     */
    List<ClinicOrdersVo> queryList (ClinicOrdersBo bo);

    /**
     * 修改门诊医嘱
     */
    ClinicOrdersVo insertByBo (ClinicOrdersBo bo);

    /**
     * 修改门诊医嘱
     */
    Boolean updateByBo (ClinicOrdersBo bo);

    /**
     * 校验并批量删除门诊医嘱信息
     */
    Boolean deleteWithValidByIds (Collection<String> ids, Boolean isValid);

    /**
     * 门诊项目保存
     *
     * @param clinicOrderParam clinicOrder 入参实体类
     * @return
     */
    Boolean saveByBo (ClinicOrderParam clinicOrderParam);

    /**
     * 保存门诊医嘱信息
     *
     * @param param
     * @return
     */
    ClinicOrders initClinicOrders (ClinicOrderParam param);

    /**
     * 根据orgId和applyNo 删除门诊医嘱目
     *
     * @param orgId   机构id
     * @param applyNo 申请单号
     * @return Boolean
     */
    Boolean deleteByBo (String orgId, String applyNo);

    boolean update (LambdaUpdateWrapper<ClinicOrders> lambdaUpdateWrapper);


    /**
     * 组织ClinicOrder实体数据
     *
     * @param param
     * @return
     */
    ClinicOrders getClinicOrders (ClinicOrderParam param);

    /**
     * 更新clinic_orders 实收、应收金额
     *
     * @param costs                            应收
     * @param paidUpAmount                     实收
     * @param whetherToComeInAttachedItemClass 附加项目类型
     * @param clinicOrders                     门诊医嘱
     */
    void updateCharges (BigDecimal costs, BigDecimal paidUpAmount, String whetherToComeInAttachedItemClass, ClinicOrders clinicOrders);

    /**
     * 修改收费状态
     *
     * @param bo
     * @return
     */
    boolean updateChargeFlag (ClinicOrdersBo bo);
}
